home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Serving Financial Service…olutions Suite 1994 Fall
/
Serving Financial Services Solutions Suite 1994 Fall.iso
/
GS_Apps
/
License
/
update_issd6
< prev
next >
Wrap
Text File
|
1994-12-14
|
5KB
|
168 lines
#!/bin/csh -f
# Usage update_issd6
# Last modified Sun Apr 3 17:11:28 EDT 1994
# update_issd6 does the following:
# 1. Check to see if issd6 is installed in /etc/inetd.conf
# If it is then comment it out.
# 2. Kill all running locald6's and issd6's
# 3. Copy the latest issd6 and locald6 into old versions.
# 4. Install issd6 in /etc/rc.local
#
# Standard system files
set INETD_FILE = "/etc/inetd.conf"
set RCLOCAL = "/etc/rc.local"
# Standard directory for Apps
set STANDARD_DIRS = "/LocalApps"
# Current version of XNet License daemons you are using.
set VERSION = 66
# List of commands
set PS = "/bin/ps acux"
set MV = "/bin/mv"
set CP = "/bin/cp"
set GREP = "/bin/grep"
set KILL = "/bin/kill"
set SED = "/bin/sed"
#********* 1 *************
echo ".....Checking ${INETD_FILE}....."
set inet = `$GREP 300162/2 ${INETD_FILE}`
if ($#inet != 0) then
$SED -e "/300162\/2/ d" < ${INETD_FILE} > ${INETD_FILE}.iss
$MV ${INETD_FILE} ${INETD_FILE}.preiss
$MV ${INETD_FILE}.iss ${INETD_FILE}
echo "${INETD_FILE} was altered to remove old versions of issd6"
echo "The old ${INETD_FILE} has been saved in ${INETD_FILE}.preiss"
echo "We recommend sending a signal to inetd to reread this file"
echo -n "If you do not wish to do this, please enter No --> "
set input = $<
if ($input != "No") then
echo "Restarting inetd"
set pid = `$PS | $GREP inetd`
$KILL -HUP $pid[2]
endif
endif
echo ".....Done....."
echo "------------------------------------------------------------------"
echo ""
#********* 2 ****************************
# Kill all existing locald6's and issd6's
set issd6 = `$PS | $GREP issd6`
set numissd6 = $#issd6
if ($numissd6 != 0) then
echo ".....Killing issd6....."
endif
while ($#issd6 != 0)
echo -n "Kill pid $issd6[2] [y/n]"
set input = $<
if ($input == "y") then
$KILL -9 $issd6[2]
endif
set issd6 = `$PS | $GREP issd6`
end
if ($numissd6 != 0) then
echo ".....Done....."
echo "------------------------------------------------------------------"
echo ""
endif
set locald6 = `$PS | $GREP locald6`
set numlocald6 = $#locald6
if ($numlocald6 != 0) then
echo ".....Killing locald6....."
endif
while ($#locald6 != 0)
echo -n "Kill pid $locald6[2] [y/n]"
set input = $<
if ($input == "y") then
$KILL -9 $locald6[2]
endif
set locald6 = `$PS | $GREP locald6`
end
if ($numlocald6 != 0) then
echo ".....Done....."
echo "------------------------------------------------------------------"
echo ""
endif
#**************** 3 ****************************
# Replacing old versions of issd6 and locald6
echo "We recommend replacing old versions of the daemons issd6 and locald6"
echo "to prevent conflicts from occurring"
echo -n "Would you like us to do this automatically [y/n] -->"
set input = $<
if ($input != "y") then
echo "Please replace any old versions of locald6 or issd6 with the"
echo "newer versions of locald6 and issd6"
echo "------------------------------------------------------------------"
echo ""
else
echo ".....Replacing old versions of issd6 and locald6....."
echo -n "Please enter places other than $STANDARD_DIRS that I should look -->"
set input = $<
set DIRS = "$STANDARD_DIRS $input"
echo $DIRS
foreach dir ($DIRS)
if (-e $dir) then
find $dir -name locald6 -ok $CP ./locald6 {} \;
find $dir -name issd6 -ok $CP ./issd6 {} \;
else
echo "$dir does not exist"
endif
end
echo ".....Done....."
echo "------------------------------------------------------------------"
echo ""
endif
#******* This section actually installs issd6 *****************
#******* 4 ****************************************************
if ($1 == "") then
set ISSDDIR = `pwd`
else
set ISSDDIR = $1
endif
set grepresult = `$GREP issd6 ${RCLOCAL}`
set num_words = $#grepresult
if ($num_words != 0) then
set versiongrep = `$GREP XNet ${RCLOCAL}`
set oldversion = $versiongrep[2]
if ($oldversion < $VERSION) then
echo "Older version of issd6 already installed in ${RCLOCAL}"
echo "New version is backward compatible with older licensing"
echo -n "Replace old version with newer version? [y/n] -->"
set input = $<
if ($input == "y") then
echo ".....Installing issd6....."
$SED -e "/issd6/ d" -e "/$versiongrep/ d" < $RCLOCAL > ${RCLOCAL}.iss
$MV ${RCLOCAL} ${RCLOCAL}.preiss
$MV ${RCLOCAL}.iss ${RCLOCAL}
echo "# $VERSION XNet Licensing--do not edit this line" >>& ${RCLOCAL}
echo "${ISSDDIR}/issd6 -i" >>& ${RCLOCAL}
${ISSDDIR}/issd6 -i
echo ".....Done....."
endif
else
echo "issd6 has already been installed"
exit
endif
endif